Speed up which-key--maybe-replace
authorRudi Grinberg <me@rgrinberg.com>
Fri, 17 Jul 2020 01:14:09 +0000 (18:14 -0700)
committerJustin Burkett <justin@burkett.cc>
Tue, 21 Jul 2020 19:27:24 +0000 (15:27 -0400)
commit3642c11d5ef9be3c6fb9edb8fd5ec3c370abd889
treeffd66522da0ae19bc1a58d6923160d0a8e7ad1fc
parentce25fb260003eb965e1c104804f690d9405ec8b4
Speed up which-key--maybe-replace

The first optimization is avoiding the intermediate list created by
append. Instead we just iterate over the two lists in turn

The second opimitization occurs where
which-key-allow-multiple-replacements is nil, in which case we can stop
the iteration once we've found a replacement

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
which-key.el